
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.Iterator,
                 com.scalar.chiptrack.utils.ConfigManager, 
                 com.scalar.chiptrack.operations.packingslip.dao.LotQtyPullAuditDAO,
                 com.scalar.chiptrack.operations.packingslip.LotQtyPullAudit,
                 com.scalar.chiptrack.operations.packingslip.LotQtyPullAuditList"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<!--chiptrack:checkLogon sourcePage="/changePassword.do"/-->

<html:html>

<HEAD><TITLE>ChipTrac - Lot Audit</TITLE>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
</HEAD>
<BODY bgColor='#ffffff' leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">


<table bgcolor='FDF5E6' border="0" width="98%" align=center cellpadding='4'>

<%String lotNumber = request.getParameter( "lotNumber" );
   // added by hareesh on 18th August 2003
   // -- START --
  String strlotId = request.getParameter("lotId");
  int lotId = -1;
  try{
      lotId = Integer.parseInt(strlotId);
  }catch(Exception ex){
    lotId = -1;
  }
    // -- END --
%>

    <tr><td colspan='6' bgcolor="#993333" align='center'><font class='NArialW'><font color='#FFFFFF'>Lot Audit - <%=lotNumber%></font></font></td></tr>
    <tr><td colspan='6'><img height=5 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif"></td></tr>

    <tr>
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >For Sales Order#</font></td>
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >Line Item#</font></td>
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >
		<bean:message key = "label.mfgPartNumber" /></font></td>
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >Qty Pulled By</font></td>
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >Qty Pulled On</font></td>        
        <td nowrap align=center bgcolor="#999CCC"><font class="NArialL" >Qty Pulled</font></td>
    </tr>

    
<%
    // changed by hareesh on 18th Agusut 2003
    // -- START --
    //LotQtyPullAuditList lotQtyPullAuditList =  LotQtyPullAuditDAO.loadLotQtyPullAuditList( lotNumber );
    LotQtyPullAuditList lotQtyPullAuditList =  LotQtyPullAuditDAO.loadLotQtyPullAuditList( lotId );
    // -- END --
    Iterator lotQtyPullAuditListIterator = lotQtyPullAuditList.iterator();

    LotQtyPullAudit lotQtyPullAudit = null;
    int i=0;
    String bgcolor[] = {"#FFFFCC", "#DEE1E2"};
    int totalQtyPulled = 0;

    while( lotQtyPullAuditListIterator.hasNext() ) 
    {
        lotQtyPullAudit = ( LotQtyPullAudit ) lotQtyPullAuditListIterator.next();
        if( ( lotQtyPullAudit != null ) && ( lotQtyPullAudit.getQtyPulled() > 0 ) )
        {
%>

        <tr>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" >&nbsp;&nbsp;<%=lotQtyPullAudit.getSalesOrderNumber()%></font></td>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" >&nbsp;&nbsp;<%=lotQtyPullAudit.getLineItemNumber()%></font></td>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" >&nbsp;&nbsp;<%=lotQtyPullAudit.getPartNumber()%></font></td>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" >&nbsp;&nbsp;<%=lotQtyPullAudit.getQtyPulledBy()%></font></td>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" >&nbsp;&nbsp;<%=lotQtyPullAudit.getQtyPulledOn()%></font></td>
            <td bgcolor='<%=bgcolor[i%2]%>' align=center><font class="NArialL" ><%=lotQtyPullAudit.getQtyPulled()%></font></td>
        </tr>
<%
            totalQtyPulled += lotQtyPullAudit.getQtyPulled();
            i++;
        }
    }
%>

    <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>

    <tr>
    <td colspan=5 align=right><font class='NArialL'>Total Quantity Pulled:&nbsp;&nbsp;</font></td>
    <td align=left><font class='NArialL'><%=totalQtyPulled%></font></td>
    </tr>

    <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=10></td></tr>

    <tr><td colspan=6 align=center><a href="javascript:window.close();" onMouseOver="window.status='Click here to close this window';return true"><font class='NArialL'>[Close this window]</font></a></td></tr>

    <tr><td colspan=6><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=40></td></tr>
</table>


</BODY>

</html:html>